package com.aspose.cells;

class zaou extends zaok {
   private double[] b;
   private int c;
   private int d;

   public zaou(double[] var1, int var2, int var3) {
      this.b = var1;
      this.c = var2;
      this.d = var3;
   }

   public double b(double var1) {
      double var3 = 0.0D;
      double var5 = var1 * var1;

      for(int var7 = this.c + 1; var7 < this.d; ++var7) {
         var3 -= (double)(var7 - this.c) * this.b[var7] / var5;
         var5 *= var1;
      }

      return var3;
   }

   public double a(double var1) {
      double var3 = this.b[this.c];
      double var5 = var1;

      for(int var7 = this.c + 1; var7 < this.d; ++var7) {
         var3 += this.b[var7] / var5;
         var5 *= var1;
      }

      return var3;
   }

   zagu c(double var1) {
      double var3 = 0.0D;

      int var5;
      for(var5 = this.c; var5 < this.d; ++var5) {
         var3 += this.b[var5];
      }

      if (var3 > 0.0D) {
         if (var1 < 0.0D) {
            var1 = 0.1D;
         }
      } else {
         if (var3 >= 0.0D) {
            return zyy.a;
         }

         if (var1 > 0.0D) {
            var1 = -1.0E-4D;
         }
      }

      var5 = this.a(var1 + 1.0D, 1.0E-7D, 20);
      if (var5 != 0 || this.a <= 0.0D) {
         var5 = this.a(var3 / this.b[0] / (double)(this.d - this.c - 1) + 1.0D, 1.0E-7D, 20);
         if (var5 != 0 || this.a <= 0.0D) {
            double var6 = var1;

            int var8;
            for(var8 = 0; var8 < 10; ++var8) {
               var1 /= 2.0D;
               var5 = this.a(var1 + 1.0D, 1.0E-7D, 20);
               if (var5 == 0 && this.a > 0.0D) {
                  break;
               }
            }

            if (var5 == 2) {
               var1 = var1;

               for(var8 = 0; var8 < 10; ++var8) {
                  var1 += var6;
                  var5 = this.a(var1 + 1.0D, 1.0E-7D, 20);
                  if (var5 == 0 && this.a > 0.0D) {
                     break;
                  }
               }
            }
         }
      }

      if (var5 == 0) {
         return (zagu)(this.a < 0.0D ? zze.a : new zyy(this.a - 1.0D));
      } else {
         return zze.a;
      }
   }
}
